@extends('home.home')
@section('content')	
<!--content-->
<!---->
        <head>
        	<style>
                 a[class*="info-"]:hover{background: rgb(239,95,33);color: white;}

                 .ct-1 {display: none;}
                 .ct-2 {display: none;}
                 .ct-3 {display: block;}
                 .content li {list-style: none;}
        	</style>
        </head>
		<div class="product">
			<div class="container">
				<div class="col-md-3 product-price">
					  
				<div class=" rsidebar span_1_of_left">
					<div class="of-left">
						<h3 class="cate">类别</h3>
					</div>
		<ul class="menu">
		<li class="item1"><a href="{{url('/home/good/index')}}/{{1}}">男装 </a>
			<ul class="cute">
				@foreach($list[1] as $v)
				<li class="subitem1"><a href="{{url('/home/good/index')}}/{{$v->tid}}">{{$v->tname}}</a></li>
				@endforeach
			</ul>
		</li>
		<li class="item2"><a href="#">女装 </a>
			<ul class="cute">
				@foreach($list[2] as $v)
				<li class="subitem1"><a href="{{url('/home/good/index')}}/{{$v->tid}}">{{$v->tname}}</a></li>
				@endforeach
			</ul>
		</li>
		<li class="item3"><a href="#">童装</a>
			<ul class="cute">
				@foreach($list[3] as $v)
				<li class="subitem1"><a href="{{url('/home/good/index')}}/{{$v->tid}}">{{$v->tname}}</a></li>
				@endforeach
			</ul>
		</li>
		<li class="item4"><a href="#">其它</a>
			<ul class="cute">
				@foreach($list[12] as $v)
				<li class="subitem1"><a href="{{url('/home/good/index')}}/{{$v->tid}}">{{$v->tname}}</a></li>
				@endforeach
			</ul>
		</li>
				
		<li class="item4"><a href="#">鞋子</a>
			<ul class="cute">
				@foreach($list[13] as $v)
				<li class="subitem1"><a href="{{url('/home/good/index')}}/{{$v->tid}}">{{$v->tname}}</a></li>
				@endforeach
			</ul>
		</li>
	</ul>

					</div>
				<!--initiate accordion-->
		<script type="text/javascript">
			$(function() {
			    var menu_ul = $('.menu > li > ul'),
			           menu_a  = $('.menu > li > a');
			    menu_ul.hide();
			    menu_a.click(function(e) {
			        e.preventDefault();
			        if(!$(this).hasClass('active')) {
			            menu_a.removeClass('active');
			            menu_ul.filter(':visible').slideUp('normal');
			            $(this).addClass('active').next().stop(true,true).slideDown('normal');
			        } else {
			            $(this).removeClass('active');
			            $(this).next().stop(true,true).slideUp('normal');
			        }
			    });
			
			});
		</script>
<!---->
	<div class="product-middle">
		
					<div class="fit-top">
						<h6 class="shop-top">Lorem Ipsum</h6>
						<a href="single.html" class="shop-now">SHOP NOW</a>
<div class="clearfix"> </div>
	</div>
				</div>	 
						<div class="sellers">
							<div class="of-left-in">
								<h3 class="tag">标签</h3>
							</div>
								<div class="tags">
									<ul>
										<li><a href="#">设计</a></li>
										<li><a href="#">时尚</a></li>
										<li><a href="#">流行</a></li>
										<li><a href="#">连衣裙</a></li>
										<li><a href="#">设计</a></li>
										<li><a href="#">时尚</a></li>
										<li><a href="#">流行</a></li>
										<li><a href="#">连衣裙</a></li>
										<li><a href="#">设计</a></li>
										<li><a href="#">时尚</a></li>
										<li><a href="#">流行</a></li>
										<li><a href="#">连衣裙</a></li>
										
										<div class="clearfix"> </div>
									</ul>
								
								</div>
								
		</div>
				<!---->
				<div class="product-bottom">
					<div class="of-left-in">
								<h3 class="best">最畅销</h3>
							</div>
						@foreach($case as $ww)	
					<div class="product-go">
						<div class=" fashion-grid">
									<a href="single.html"><img class="img-responsive " src="{{asset($ww->gpic)}}" alt=""></a>
									
								</div>
							<div class=" fashion-grid1">
								<h6 class="best2"><a href="single.html" >{{$ww->gdesc}}</a></h6>
								
								<span class=" price-in1">{{$ww->price}}￥</span>
							</div>
								
							<div class="clearfix"> </div>
					</div>
					@endforeach
					
				</div>
<div class=" per1">
				<a href="single.html" ><img class="img-responsive" src="{{asset('/shop/images/pro.jpg')}}" alt="">
				<div class="six1">
					<h4>DISCOUNT</h4>
					<p>Up to</p>
					<span>60%</span>
				</div></a>
			</div>
				</div>
				<div class="col-md-9 product-price1">
				<div class="col-md-5 single-top">	
<div class="flexslider">
  <ul class="slides">
    <li data-thumb="{{asset($data -> gpic)}}">
      <img src="{{asset($data -> gpic)}}" />
    </li>
    <li data-thumb="{{asset($data -> gpic)}}">
      <img src="{{asset($data -> gpic)}}" />
    </li>
    <li data-thumb="{{asset($data -> gpic)}}">
      <img src="{{asset($data -> gpic)}}" />
    </li>
    <li data-thumb="{{asset($data -> gpic)}}">
      <img src="{{asset($data -> gpic)}}" />
    </li>
  </ul>
</div>
<!-- FlexSlider -->
  <script defer src="{{asset('/shop/js/jquery.flexslider.js')}}"></script>
<link rel="stylesheet" href="{{asset('/shop/css/flexslider.css')}}" type="text/css" media="screen" />

<script>
// Can also be used with $(document).ready()
$(window).load(function() {
  $('.flexslider').flexslider({
    animation: "slide",
    controlNav: "thumbnails"
  });
});
</script>
					</div>	
					<div class="col-md-7 single-top-in simpleCart_shelfItem">
						<div class="single-para ">
						<h4>{{$data -> gname}}    <b style="color:red;font-size: 20px;">销量：{{ $data -> scnt}}</b></h4>
									
							<div class="star-on">
								<ul class="star-footer">
										@if($avg>=0 && $avg<2)
										<li><a href="#"><i> </i></a></li>
								        @elseif($avg>=2 && $avg<3 )
										<li><a href="#"><i> </i></a></li>
										<li><a href="#"><i> </i></a></li>
                                        @elseif($avg>=3 && $avg<4 )
										<li><a href="#"><i> </i></a></li>
										<li><a href="#"><i> </i></a></li>
										<li><a href="#"><i> </i></a></li>
										@elseif($avg>=4 && $avg<5 )
										<li><a href="#"><i> </i></a></li>
										<li><a href="#"><i> </i></a></li>
										<li><a href="#"><i> </i></a></li>
										<li><a href="#"><i> </i></a></li>
										@else
										<li><a href="#"><i> </i></a></li>
										<li><a href="#"><i> </i></a></li>
										<li><a href="#"><i> </i></a></li>
										<li><a href="#"><i> </i></a></li>
										<li><a href="#"><i> </i></a></li>
										@endif	
									</ul>
									
								<div class="review">
									<a href="#"> 顾客评论</a>
									
								</div>
								       
							<div class="clearfix"> </div>

							</div>
							
							<h5 class="item_price">$ {{$data->price}}</h5>
							<p>商品介绍</p>
							<div class="available">
								<ul>
									<li>颜色
										<select>
										<option>{{$data -> color}}</option>
										<option>黑色</option>
										<option>暗黑色</option>
										<option>红色</option>
									</select></li>
								<li class="size-in">尺寸<select>
									<option>{{$data -> size}}(165)</option>
									<option>L(170)</option>
									<option>XL(175)</option>
									<option>XXL(180)</option>
									<option>XXXL(最大码)</option>
								</select></li>

								<div class="clearfix"> </div>
							</ul>
							<head>
								<style>
                                  .cc-1 { display: block;width: 30px;height: 30px;text-align: center;line-height: 30px; position: absolute;background: rgb(239,95,33);font-size: 20px;}
                                  .cc-3 { width:30px; height: 30px; position: absolute;left: 70px;background: rgb(239,95,33);text-align: center;line-height: 30px;color:purple;font-size: 20px;}
                                  .cc-2 { display: block;width: 40px;height: 29px;text-align: center;line-height: 30px; position: absolute;left: 30px;}
								</style>
							</head>
							
						</div>
							<ul class="tag-men">
								<li><span>标签</span>
								<span class="women1">: {{$data->tname}}</span></li>
								
							</ul>
								<a href="javascript:docart()" class="add-cart item_add">添加到购物车</a>
								@if(session('info'))
								<span class="edit" style="color: rgb(239,95,33);">{{session('info')}}</span>
								@endif
								<form action="" id="addCart" method="post">
								{{csrf_field()}}
								<div style="border:1px solid purple;width: 100px;height: 30px;position: relative;top:-293px;left:100px;margin-bottom:20px;">
								<span class="cc-1">-</span> <input class="cc-2" name="count" value=""><span class="cc-3">+</span>
							</div>
									<input type="hidden" name="gid" value="{{$data ->gid}}">
								
								</form>
								<script>
                                    $('.edit').fadeOut(2000);
									function docart()
									{
										var addCart = $('#addCart');
										addCart.attr('action',"{{url('/home/cart/insert')}}");
                                        addCart.submit();
									}
									var $bcnt =1;
									$('.cc-2').val($bcnt);
									var jia = $('.cc-3').on('click',function(){
                                         $('.cc-2').val(++$bcnt);
                                         console.log($bcnt);
									})
									
									var jia = $('.cc-1').on('click',function(){
										 $('.cc-2').val($bcnt);

                                         $('.cc-2').val($bcnt -=1);

                                      
                                         console.log($bcnt);
									})

								</script>
							
						</div>
					</div>
				<div class="clearfix"> </div>
			<!---->
<div class="cd-tabs">
			<nav>
				<ul class="cd-tabs-navigation">
					<li><a data-content="fashion"  href="#0" class="info-1">描述 </a></li>
					<li><a data-content="cinema" href="#0" class="info-2">更多信息</a></li>
					<li><a data-content="television" href="" class="info-3">评论</a></li>
					
				</ul> 
			</nav>
			<div style="height: 20px;"></div>
	<ul class="content">
		<li data-content="fashion">
		<div class="ct-1">
					  <p >{{$data -> des}} </p>
					  <div style="height: 20px;"></div>
	    </div>
        
        </li>
        
										<li data-content="cinema" >
											<div class="ct-2">
															
												<div class="color"><p>颜色</p>
													<span >红色, 蓝色, 墨绿色</span>
													<div class="clearfix"></div>
												</div>
												<div class="color">
													<p>尺寸</p>
													<span >S, M, L, XL</span>
													<div class="clearfix"></div>
											    </div>
											    <div style="height: 20px;"></div>
															        
										  </div>

										</li>
										
								<li data-content="television" >
									        <div  class="ct-3" >
									        @foreach($comment as $row)
												<div class="top-comment-left">
													<img class="img-responsive" src="{{asset($row->uface)}}" width="40px;" >
												</div>
												<div class="top-comment-right">
													<h6>{{$row->uname}}</h6>
													<ul class="star-footer">
														@if($row -> pf>=0 && $row -> pf<2)
														买家评星: <li><a href="#"><i> </i></a></li>
												        @elseif($row -> pf>=2 && $row -> pf<3 )
														买家评星: <li><a href="#"><i> </i></a></li>
														<li><a href="#"><i> </i></a></li>
				                                        @elseif($row -> pf>=3 && $row -> pf<4 )
														买家评星: <li><a href="#"><i> </i></a></li>
														<li><a href="#"><i> </i></a></li>
														<li><a href="#"><i> </i></a></li>
														@elseif($row -> pf>=4 && $row -> pf<5 )
														买家评星: <li><a href="#"><i> </i></a></li>
														<li><a href="#"><i> </i></a></li>
														<li><a href="#"><i> </i></a></li>
														<li><a href="#"><i> </i></a></li>
														@else
														买家评星: <li><a href="#"><i> </i></a></li>
														<li><a href="#"><i> </i></a></li>
														<li><a href="#"><i> </i></a></li>
														<li><a href="#"><i> </i></a></li>
														<li><a href="#"><i> </i></a></li>
														@endif

																	</ul>
																	<p>{{$row -> words}}</p>
												</div>
												@endforeach
												<div class="clearfix"> </div>
												@if(!empty($status))
												@foreach($status as $pp)
												@if($pp->status == 1 )
												@if($pp->gid == $data->gid)
												<form action="{{url('/home/good/insert')}}" method="post">
													{{ csrf_field()}}
												商品评分:  <input type="radio" name="pf" value="1" style="margin-left: 45px;margin-top: 20px;height:40">1分
												<input type="radio" name="pf" value="2" style="margin-left: 45px;margin-top: 20px;height:40">2分
												<input type="radio" name="pf" value="3" style="margin-left: 45px;margin-top: 20px;height:40">3分
												<input type="radio" name="pf" value="4" style="margin-left: 45px;margin-top: 20px;height:40">4分
												<input type="radio" name="pf" value="5" style="margin-left: 45px;margin-top: 20px;height:40">5分

												<input type="hidden" name="gid" value="{{ $data -> gid}}">

												<textarea name="words" cols="80" rows="3" style="margin-left: 45px;margin-top: 20px;"></textarea>
												<button>添加评论</button>
												</form>
												@endif
												@endif
												@endforeach
                                                @endif
												<div style="height: 30px;"></div>
											</div>

								</li>
								<script>
									$('.info-1').on('click',function(){
                                         $('.ct-1').css('display','block');
                                         $('.ct-2').css('display','none');
                                         $('.ct-3').css('display','none');
                                         
									});
									$('.info-2').on('click',function(){
										 $('.ct-3').css('display','none');
                                         $('.ct-2').css('display','block');
                                         $('.ct-1').css('display','none');
                                         
									});
									$('.info-3').on('click',function(){
                                         $('.ct-3').css('display','block');
                                         $('.ct-2').css('display','none');
                                         $('.ct-1').css('display','none');
                                         
									});
								</script>
                   <div class="clearfix"></div>
                </ul> 
              </div> 

<div class=" bottom-product">
		            @foreach($sim as $ss)
					<div class="col-md-4 bottom-cd simpleCart_shelfItem">
						<div class="product-at ">
							<a href="{{ url('/home/good/list')}}/{{ $ss -> gid }}"><img class="img-responsive" src="{{asset($ss->gpic)}}" alt="">
							<div class="pro-grid">
										<span class="buy-in">现在购买</span>
							</div>
						</a>	
						</div>
						<p class="tun">{{$ss->gname}}</p>
						<a href="#" class="item_add"><p class="number item_price"><i> </i>$500.00</p></a>						
					</div>
                    @endforeach
					
					<div class="clearfix"> </div>
				</div>
</div>

		<div class="clearfix"> </div>
		</div>
		</div>
<!--//content-->
@endsection			